package com.itheima.domain;

import java.util.Scanner;

public class DuiChenString {
    public static void main(String[] args) {

        //对称字符串判断
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入对称字符串：");
        String s = sc.nextLine();

        //创建StringBuilder对象 是为了 调用 reverse方法
        StringBuilder sb = new StringBuilder(s);

        //此处反转之后类型是 StringBuilder
        sb.reverse();

        //StringBuilder 转换为 String
        String s1 = sb.toString();

        if(s.equals(s1)){
            System.out.println("是对称字符串");
        }else{
            System.out.println("不是对称字符串");
        }
    }
}
